<?php        
    /**
     * 0    = General database exception
     * 10   = Insert failure
     * 20   = Update failure
     * 30   = Select failure
     * 40   = Delete failure
     */    
    class DBException extends BaseException {        
        public function __construct($message,$code = 0,$class = null,
                $forUser = null,Exception $previous = null) {            
            $this->_data["connectErrno"]    = DB::connectErrno();
            $this->_data["connectError"]    = DB::connectError();
            $this->_data["errno"]           = DB::errno();
            $this->_data["error"]           = DB::error();
            $this->_data["forUser"]         = $forUser;
            $this->_data["sql"]             = DB::get("lastsql");
            parent::__construct($message,$code,$class,$previous);
        }
    }